package com.le.tester.javaThink.fifth.chapter13_FuncProgramming;

import java.util.function.Function;

/**
 * createTime：2021/8/6 15:59
 * description：函数组合
 */
public class FunctionComposition {
    static Function<String, String> f1 = s -> {
        System.out.println(s);
        return s.replace('A', '_');
    },

    //先走到了这里进行了字符串的转换，然后才会有这个上面的输出
    f2 = s -> s.substring(3),
            f3 = String::toLowerCase,
            f4 = f1.compose(f2).andThen(f3);

    public static void main(String[] args) {
        System.out.println(f4.apply("GO AFTER ALL AMB"));
    }
}
